package main

import (
	"github.com/sirupsen/logrus"
	"github.com/gin-gonic/gin"
	"chaoyer/ghost_assist/handler"
	"chaoyer/ghost_assist/base"
	"chaoyer/ghost_assist/base/middleware"
)

func main() {

	base.Init()

	r := gin.New()
	//// 跨域设置
	r.Use(middleware.CORSMiddleware())
	// gin使用logrus日志
	r.Use(middleware.Ginrus(logrus.StandardLogger(), "2006-01-02 15:04:05", true))
	r.Use(gin.Recovery())

	// 初始化路由
	handler.RouteInit(r)
	// listen and serve on 0.0.0.0:8080
	r.Run(":4200")
}